package queuedemo;

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.LinkedList;

public class Test {

    //测试双端队列
    public static void main(String[] args) {
        //由链表实现的双端队列
        Deque<Integer> deque = new LinkedList<>();

        deque.offerFirst(1);
        deque.offerFirst(2);

        System.out.println(deque.pollLast());

        //由数组实现的双端队列
        Deque<Integer> deque2 = new ArrayDeque<>();
    }
}
